Skip to content

fix(FR-2901): sync deployment revision state in Relay store after activate / auto-activate#7428

Merged
graphite-app[bot] merged 1 commit into
mainfrom
fix/FR-2901-sync-deployment-revision-state
May 15, 2026
Merged

fix(FR-2901): sync deployment revision state in Relay store after activate / auto-activate#7428
graphite-app[bot] merged 1 commit into
mainfrom
fix/FR-2901-sync-deployment-revision-state

Conversation

@yomybaby
Copy link
Copy Markdown
Member

@yomybaby yomybaby commented May 15, 2026

Resolves #7427(FR-2901)

Stacked on #7407.

Summary

After mutations that change a deployment's currentRevisionId / deployingRevisionId, the Relay store's deployment record can fall out of sync with the server, causing the row tags in the revision history table and the Configuration Section's "current / deploying" panels to drift apart from what the server thinks. Two specific gaps were addressed:

  • activateDeploymentRevision (Revision History → Deploy) — Mutation response previously returned only deployment { id, currentRevisionId, currentRevision { id } }. Extended to include deployingRevisionId and ...DeploymentRevisionDetail_revision fragment on both currentRevision and deployingRevision @since(version: "26.4.3"), so the normalized deployment record updates atomically. Consumers (DeploymentDetailPage, DeploymentConfigurationSection, DeploymentRevisionHistoryTab row tags) all share the same Relay store record and re-render on the next render pass.

  • addModelRevision (Add Revision modal, both Preset and Custom modes) — Now that the backend exposes ModelRevision.deployment (feat(BA-6056): expose deployment_id and deployment Node on ModelRevision backend.ai#11631 / BA-6056), the mutation reaches into revision.deployment @since(version: "26.4.4") and selects currentRevisionId, deployingRevisionId, currentRevision, deployingRevision, so the deployment node is updated unconditionally on every revision add. No autoActivate branching — Relay normalizes the shared deployment node either way.

    • The previous client-side fetchQuery workaround helper is removed.
    • The revision selection itself was reduced to id + ...DeploymentRevisionDetail_revision. The previously inlined fields (resourceConfig.resourceOpts, modelRuntimeConfig.runtimeVariantId, modelDefinition.models[].service.preStartActions / shell / healthCheck.expectedStatusCode, etc.) were dead selections — none of the response handlers read them, and the actual consumers (AdminDeploymentPresetSettingPageContent, AdminDeploymentPresetModelConfigItem, DeploymentPresetDetailModal) have their own queries.
  • data/schema.graphql — Regenerated to add ModelRevision.deploymentId: ID! and ModelRevision.deployment: ModelDeployment per the merged backend PR.

Test plan

  • Open a deployment detail with multiple revisions in the Revision History tab. Click Deploy on a non-current revision → confirm the "Current" / "배포중" row tags AND the Configuration Section's currentRevision / deployingRevision panels both update without a manual refresh.
  • From the same page open Add Revision modal in either Preset or Custom mode with Auto activate ON → submit → modal closes, success toast shows. Verify the Configuration Section moves to "deploying" state and the new revision appears as deployingRevision without a manual refresh.
  • Same flow with Auto activate OFF → deployment record is still refreshed by the mutation (no autoActivate branching). deployingRevisionId typically stays unchanged on the server side; UI should show the new revision in history without an orphan "deploying" state.
  • Backend lifecycle: leave the page idle while a deploying revision becomes current. The 5s useInterval polling in DeploymentConfigurationSection continues to work because deployingRevision is correctly populated immediately after the mutation.

Backend dependency

Requires backend manager with lablup/backend.ai#11631 (BA-6056) — ModelRevision.deployment / ModelRevision.deploymentId. Older managers without the field will see the @since(version: "26.4.4") directive strip the field at request time, falling back to no auto-update for addModelRevision (the activate path is unaffected).

Copilot AI review requested due to automatic review settings May 15, 2026 05:53
@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization size:XL 500~ LoC labels May 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Relay store synchronization gaps after mutations that change a deployment's currentRevisionId / deployingRevisionId, ensuring the revision history table tags and Configuration Section indicators stay consistent with server state without requiring a manual refresh.

Changes:

  • Extend the activateDeploymentRevision mutation response in DeploymentRevisionHistoryTab.tsx to include deployingRevisionId plus ...DeploymentRevisionDetail_revision on both currentRevision and deployingRevision, so the normalized deployment record updates atomically.
  • In DeploymentAddRevisionModal.tsx, add a temporary refetchDeploymentRevisionStateAfterAutoActivate helper (best-effort fetchQuery) that runs after addModelRevision with autoActivate: true in both Custom and Preset modes, until AddRevisionPayload.deployment is exposed by the backend.
  • The bulk of the diff carries over changes from the stacked PR #7407 (resource group at deployment level, new ModelReplica status fields, preset detail modal architecture, i18n updates for 22 locales, etc.).

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.

Show a summary per file
File Description
react/src/components/DeploymentRevisionHistoryTab.tsx Extends activate mutation selection with deployingRevisionId / deployingRevision + revision detail fragments; switches notifications from upsertNotification to message; removes resource-group column and filter.
react/src/components/DeploymentAddRevisionModal.tsx Adds best-effort post-activate refetch helper for the auto-activate path; large refactor from stacked PR (preset mode now calls addModelRevision, hides RG selector, on-demand preset detail fetch, etc.).
react/src/components/DeploymentConfigurationSection.tsx, DeploymentDetailPage.tsx, VFolderNodes.tsx, VFolderNodesV2.tsx, ModelCardDrawer.tsx Migrate Button onClickBAIButton action for modal-mounting transitions; add local Suspense boundaries around lazy-mounted modals.
react/src/components/ModelCardDeployModal.tsx, VFolderDeployModal.tsx Switch to useFragment-based preset list; use Antd modal okButtonProps / confirmLoading instead of in-body footer; defer query with useDeferredValue; preserve afterClose for auto-deploy null-render path.
react/src/components/DeploymentPresetDetailModal.tsx Move preset name into modal title.
react/src/components/DeploymentList.tsx, DeploymentReplicasTab.tsx, DeploymentRevisionDetail.tsx, ReplicaStatusTag.tsx Add Deployment ID / Revision number columns, new replica status / trafficStatus / healthStatus columns, expanded ReplicaStatus enum with WARMING_UP/RUNNING/FAILED_TO_START.
react/src/components/DeploymentSettingModal.tsx, SessionFormItems/ResourceAllocationFormItems.tsx Add resource group selector (read-only in edit mode) at deployment level; add hideResourceGroupFormItem prop.
react/src/pages/DeploymentListPage.tsx Set autoUpdateDelay={15_000} on the fetch-key button.
data/schema.graphql Schema updates from stacked PR (new ResourceGroup on ModelDeploymentMetadata, ReplicaHealthStatus/TrafficStatus, deprecation of inference runtime config queries, etc.).
resources/i18n/*.json (22 files) Add RevisionAdded, WarmingUp, FailedToStart, Running, Terminated tooltips; remove CurrentRevisionAvailableTitle / NameAndID; localize ActivePool; update DeployFailed/DeploySuccess wording.

Copy link
Copy Markdown
Member Author

yomybaby commented May 15, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.53% 1785 / 27324
🔵 Statements 5.37% 1980 / 36806
🔵 Functions 5.24% 296 / 5642
🔵 Branches 3.75% 1293 / 34404
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/DeploymentAddRevisionModal.tsx 0% 0% 0% 0% 129-1610
react/src/components/DeploymentRevisionHistoryTab.tsx 0% 0% 0% 0% 63-671
Generated in workflow #757 for commit 36cfa9c by the Vitest Coverage Report Action

@yomybaby yomybaby force-pushed the fix/FR-2901-sync-deployment-revision-state branch 2 times, most recently from 3bbd576 to 36cfa9c Compare May 15, 2026 07:08
@agatha197 agatha197 changed the base branch from 05-13-feat_fr-2891_move_resource_group_to_deployment-level_metadata_and_refine_deployment_detail_ui to graphite-base/7428 May 15, 2026 07:12
@yomybaby yomybaby requested review from agatha197 and nowgnuesLee May 15, 2026 07:14
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change merge target branch to 05-13-feat__move_resource_group_to_deployment-level_metadata_and_refine_deployment_detail_ui

@agatha197 agatha197 changed the base branch from graphite-base/7428 to 05-13-feat_fr-2891_move_resource_group_to_deployment-level_metadata_and_refine_deployment_detail_ui May 15, 2026 07:43
@agatha197 agatha197 force-pushed the 05-13-feat_fr-2891_move_resource_group_to_deployment-level_metadata_and_refine_deployment_detail_ui branch from dc98ec8 to e2b6b31 Compare May 15, 2026 07:45
@agatha197 agatha197 force-pushed the fix/FR-2901-sync-deployment-revision-state branch from 36cfa9c to 2a7da32 Compare May 15, 2026 07:45
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 15, 2026

Merge activity

…ivate / auto-activate (#7428)

Resolves #7427(FR-2901)

Stacked on #7407.

## Summary

After mutations that change a deployment's `currentRevisionId` / `deployingRevisionId`, the Relay store's deployment record can fall out of sync with the server, causing the row tags in the revision history table and the Configuration Section's "current / deploying" panels to drift apart from what the server thinks. Two specific gaps were addressed:

- **`activateDeploymentRevision` (Revision History → Deploy)** — Mutation response previously returned only `deployment { id, currentRevisionId, currentRevision { id } }`. Extended to include `deployingRevisionId` and `...DeploymentRevisionDetail_revision` fragment on both `currentRevision` and `deployingRevision @SInCE(version: "26.4.3")`, so the normalized deployment record updates atomically. Consumers (`DeploymentDetailPage`, `DeploymentConfigurationSection`, `DeploymentRevisionHistoryTab` row tags) all share the same Relay store record and re-render on the next render pass.

- **`addModelRevision` (Add Revision modal, both Preset and Custom modes)** — Now that the backend exposes `ModelRevision.deployment` (lablup/backend.ai#11631 / BA-6056), the mutation reaches into `revision.deployment @SInCE(version: "26.4.4")` and selects `currentRevisionId`, `deployingRevisionId`, `currentRevision`, `deployingRevision`, so the deployment node is updated unconditionally on every revision add. No `autoActivate` branching — Relay normalizes the shared deployment node either way.
  - The previous client-side `fetchQuery` workaround helper is removed.
  - The `revision` selection itself was reduced to `id` + `...DeploymentRevisionDetail_revision`. The previously inlined fields (`resourceConfig.resourceOpts`, `modelRuntimeConfig.runtimeVariantId`, `modelDefinition.models[].service.preStartActions / shell / healthCheck.expectedStatusCode`, etc.) were dead selections — none of the response handlers read them, and the actual consumers (`AdminDeploymentPresetSettingPageContent`, `AdminDeploymentPresetModelConfigItem`, `DeploymentPresetDetailModal`) have their own queries.

- **`data/schema.graphql`** — Regenerated to add `ModelRevision.deploymentId: ID!` and `ModelRevision.deployment: ModelDeployment` per the merged backend PR.

## Test plan

- [ ] Open a deployment detail with multiple revisions in the Revision History tab. Click **Deploy** on a non-current revision → confirm the "Current" / "배포중" row tags AND the Configuration Section's `currentRevision` / `deployingRevision` panels both update without a manual refresh.
- [ ] From the same page open **Add Revision** modal in either Preset or Custom mode with **Auto activate ON** → submit → modal closes, success toast shows. Verify the Configuration Section moves to "deploying" state and the new revision appears as `deployingRevision` without a manual refresh.
- [ ] Same flow with **Auto activate OFF** → deployment record is still refreshed by the mutation (no autoActivate branching). `deployingRevisionId` typically stays unchanged on the server side; UI should show the new revision in history without an orphan "deploying" state.
- [ ] Backend lifecycle: leave the page idle while a deploying revision becomes current. The 5s `useInterval` polling in `DeploymentConfigurationSection` continues to work because `deployingRevision` is correctly populated immediately after the mutation.

## Backend dependency

Requires backend manager with [lablup/backend.ai#11631](lablup/backend.ai#11631) (BA-6056) — `ModelRevision.deployment` / `ModelRevision.deploymentId`. Older managers without the field will see the `@since(version: "26.4.4")` directive strip the field at request time, falling back to no auto-update for `addModelRevision` (the activate path is unaffected).
@graphite-app graphite-app Bot force-pushed the 05-13-feat_fr-2891_move_resource_group_to_deployment-level_metadata_and_refine_deployment_detail_ui branch from e2b6b31 to aaff679 Compare May 15, 2026 08:00
@graphite-app graphite-app Bot force-pushed the fix/FR-2901-sync-deployment-revision-state branch from 2a7da32 to 1a73c68 Compare May 15, 2026 08:01
Base automatically changed from 05-13-feat_fr-2891_move_resource_group_to_deployment-level_metadata_and_refine_deployment_detail_ui to main May 15, 2026 08:09
@graphite-app graphite-app Bot merged commit 1a73c68 into main May 15, 2026
2 of 4 checks passed
@graphite-app graphite-app Bot deleted the fix/FR-2901-sync-deployment-revision-state branch May 15, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync deployment revision state in Relay store after activate / auto-activate

4 participants